package org.example.school.service;

import org.example.school.entity.Users;
import com.baomidou.mybatisplus.extension.service.IService;
import org.example.school.model.dto.UserDTO;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author author
 * @since 2025-09-28
 */
public interface IUsersService extends IService<Users> {

    Users login(String username, String password);

    @Transactional
        // 添加事务注解，确保所有数据库操作要么全部成功，要么全部失败
    boolean register(UserDTO userDTO);

    Users findByUsername(String username);
}
